<?php

namespace tests;

use Mockery as m;

/**
 * Class TestCase.
 */
class TestCase extends \Laravel\Lumen\Testing\TestCase
{
    protected $baseUrl = 'http://bff-app.i.txdev.org:8080';

    /**
     * Set up.
     */
    public function setUp()
    {
        parent::setUp();
        $this->refreshApplication();
        //Artisan::call('migrate');
        //\Illuminate\Support\Facades\Facade::clearResolvedInstances();
    }

    /**
     * Creates the application.
     *
     * @return \Laravel\Lumen\Application
     */
    public function createApplication()
    {
        return require __DIR__.'/../bootstrap/app.php';
    }

    /**
     * Tear down mock.
     */
    public function tearDown()
    {
        m::close();
    }

    /**
     * Mock.
     *
     * @param $obj
     *
     * @return m\MockInterface
     */
    protected function mock($obj)
    {
        $mock = m::mock($obj);
        $this->app->instance($obj, $mock);

        return $mock;
    }
}
